$(function() {
  $(document).on('click', '[data-ajax-href]', function() {
    var $el = $(this);

    var href = $el.data('ajax-href'),
        target = $el.data('ajax-target') || $el.closest('[data-ajax-target]').data('ajax-target');

    var $target = $(target);

    $.get(href).done(function(html) {
      $target.html(html);
      $el.trigger('qs:ajax-done', [$target]);
    });
  })
})
